//
//  ZWTools.h
//  cnwan
//
//  Created by LY-Coder on 2017/6/27.
//  Copyright © 2017年 xchuang. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface ZWTools : NSObject
/**
 根据16进制颜色获取rgb颜色111
 
 @param hexColor 16进制字符串:@"#eeeeee"或@"0Xeeeeee"
 @return 转换后的rgb颜色
 */
+(UIColor *)colorWithHexString: (NSString *)hexColor;
/*
 十进制颜色转换为十六进制颜色
 
 */
+ (NSString *)ToHex:(uint16_t)tmpid;
/**
 根据颜色生成图片
 
 @param color 颜色
 @return 生成的图片
 */

+(UIImage *)createImageWithColor:(UIColor *)color;
//json 转化字典∫
+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString;
/**
 生成剩余时间 天 小时 分钟
 
 @param startTime 开始时间
 @param endTime 结束时间
 @return 返回数组 三个值 负数或者0 都是 @"0"
 */
+(NSArray*)ChangeTimeArray:(NSString *)startTime endTime:(NSString*)endTime;

#pragma mark --时间转化为:x月x日格式
+(NSString *)showMonthAndDayWith:(NSString *)dateStr;

#pragma mark --初始化navigationbar
+(id)initWithNavigationBar;

#pragma mark --对NSUserDefault简单处理
+(id)objectForKey:(NSString *)defaultName;

+(void)setObject:(id)value forKey:(NSString *)defaultName;

//验证手机号
+(BOOL)validateMobile:(NSString *)mobile;

//判断是否有emoji
+(BOOL)stringContainsEmoji:(NSString *)string;

//没有内容的展示
+(UILabel *)warnNoContentLabelView:(NSString *)str;

//没有内容偏下的展示
+(UIView *)warnNoContentLabelBottomView:(NSString *)str;

//没有内容带图的展示
+(UIView *)warnNoContentWithImag:(NSString *)imagStr andLoginBtnHidden:(BOOL)hidden target:(nullable id)target withSEL:(SEL _Nullable )action;

//设置不同字体颜色
+(void)setTextColor:(UILabel *)label FontNumber:(id)font AndRange:(NSRange)range AndColor:(UIColor *)vaColor;

//自定义上下文格式button内容
+(NSMutableAttributedString *)setUpTitle:(NSString *)upStr withBottomStr:(NSString *)botStr  withUpFont:(NSInteger)upFont withBotFont:(NSInteger)botFont withTitleColor:(UIColor *)upColor withBottomColor:(UIColor *)botColor;
//等比例压缩图片大小
+ (UIImage*)imageByScalingAndCroppingForSize:(CGSize)targetSize withSourceImage:(UIImage *)sourceImage;

@end
